import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import router from './router'
import {v4} from "uuid";
import http from "./plugins/request";
import 'echarts'
import ECharts from 'vue-echarts'
Vue.component('VueEcharts', ECharts)
Vue.use(http)
Vue.use(ElementUI)
Vue.config.productionTip = false
sessionStorage.setItem('uuid',v4())


Vue.prototype.isNull= function (str) {
    // console.log("isNull = ", str);
    if (Object.prototype.toString.call(str) === '[object Undefined]' || str === null) {
      //空
      return true;
    } else if (
        Object.prototype.toString.call(str) === '[object String]' ||
        Object.prototype.toString.call(str) === '[object Array]'
    ) {
      //字条串或数组
      return str.length == 0 || str == 'undefined' ? true : false;
    } else if (Object.prototype.toString.call(str) === '[object Object]') {
      return JSON.stringify(str) == '{}' ? true : false;
    } else if (typeof str == 'number') {
      //Number 型
      if (str) {
        return false;
      } else {
        //数字0 不算空
        if (str == 0) {
          return false;
        }
        return true;
      }
    } else if (typeof str == 'boolean') {
      if (str.toString() === 'true' || str.toString() === 'false') {
        return false;
      }
      return true;
    } else {
      return str.toString().length === 0;
  }

}

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
